<template>
	<div class="concat">
		<div class="main" :style="{background: 'url( '+ bg +')'}">
			<div class="btn" @click="goSkip()">
				进入抽奖
			</div>
		</div>

	</div>
</template>

<script>
	export default {
		data() {
			return {
				activity_id: '', //活动id
				info: {},
				prize_id: '', //奖券id
				bg: '',
			}
		},
		mounted() {
			//活动id
			let activity_id = this.$route.query.id;
			this.activity_id = activity_id;
			this.getInfo(activity_id)
		},
		methods: {
			getInfo(id) {
				let params = {
					item_id: id
				}
				this.$http.post('/api/root/activity/luckdraw/data', params).then(res => {
					if (res.code == 1) {
						let data = res.data;
						this.info = data;
						this.bg = data.img[0].path;
						for (var i = 0; i < data.goods.length; i++) {
							if (data.goods[i].prize_id) {
								this.prize_id = data.goods[i].prize_id;
								break;
							}
						}
					} else {
						this.info = {};
					}
				})
			},
			goSkip() {
				let prize_id = this.prize_id;
				this.$router.push({
					name: 'rollingDisc',
					query: {
						prize_id,
						activity_id: this.activity_id
					}
				})
			},
		}
	}
</script>
<style scoped lang="less">
	@import 'index.less';
</style>

